//
//  ViewController.m
//  rnDemo
//
//  Created by 郑恒 on 2018/3/27.
//  Copyright © 2018年 Facebook. All rights reserved.
//

#import "ViewController.h"

#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import "TestUtil.h"

@interface ViewController ()<RCTBridgeModule>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
  
  
  
  
  
}

- (IBAction)clickedButton:(id)sender {
  NSURL *jsCodeLocation;
  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
  RCTRootView *rnView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
                                                      moduleName:@"IOSApi"
                                               initialProperties:nil
                                                   launchOptions:nil];
  rnView.backgroundColor = [UIColor cyanColor];
  
  UIViewController *pushVC = [[UIViewController alloc] init];
  pushVC.view = rnView;
  
  [self.navigationController pushViewController:pushVC animated:YES];
  
}

@end
